﻿CREATE VIEW [dbo].[ASMS_V_BookingBill]
	AS 
SELECT BB.*,
	C.Name as CustomerName,
	C.VIPNumber as CustomerVIPNumber,
	C.Telephone as CustomerTelephone,
	S.Name as SalesManagerName,
	A.LPN as AutomobileLPN,
	A.VIN as AutomobileVIN,
	A.Series as AutomobileSeries
FROM [ASMS_BookingBill] as BB
	inner join [ASMS_Customer] as C on C.Id = BB.CustomerId
	inner join [ASMS_Automobile] as A on A.Id = BB.AutomobileId
	left join [ASMS_Staff] as S on S.Id = BB.SalesManagerId
